<!-- 下拉选项 -->
<template>
  <div class="select">
    <el-select v-model="value" clearable :placeholder="placeholder" @change="changselect">
      <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
    </el-select>
  </div>
</template>

<script>
export default {
  props: {
    placeholder: {
      type: String
    },
     options: {
      type: Array
    }
  },
  data() {
    return {
      value: ""
    };
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {},
  methods: {
    changselect() {
      this.$emit("fromChild", this.value);
    }
  }
};
</script>
<style scoped>
/* @import url(); 引入css类 */
.select {
  margin-left: 2%;
}
</style>